wpt->shortname = str;
#else
xfree(wpt->shortname);
- wpt->shortname = str;
+ wpt->shortname = xstrdup(str);
#endif
}
} else if (!wpt->description.isEmpty()) {
name = wpt->description;
#else
+ char* name = NULL;
if ((! wpt->shortname) || global_opts.synthesize_shortnames) {
if (wpt->description && global_opts.synthesize_shortnames) {
name = mkshort_from_wpt(mkshort_handle, wpt);
name = wpt->shortname;
}
+#if NEW_STRINGS
text_len = name.length();
+#else
+ text_len = strlen(name);
+#endif
if (text_len > MAXUSRSTRINGSIZE) {
text_len = MAXUSRSTRINGSIZE;
}
gbfputint32(text_len, file_out);
- gbfwrite(CSTR(name), 1, text_len, file_out);
+ gbfwrite(CSTRc(name), 1, text_len, file_out);
if (global_opts.debug_level >= 1) {
- printf(MYNAME " waypt_disp: Waypt name = %s\n", CSTR(name));
+ printf(MYNAME " waypt_disp: Waypt name = %s\n", CSTRc(name));
}
/**
QString sn = global_opts.synthesize_shortnames ?
mkshort_from_wpt(mkshort_handle, waypointp) :
waypointp->shortname;
- QString tmp;
/*
* The format spec doesn't call out the character set of waypoint
*/
- tmp = mkshort(wpt_handle, sn);
- gbfputpstr(tmp, mapsend_file_out);
+ QString tmp1 = mkshort(wpt_handle, sn);
+ gbfputpstr(tmp1, mapsend_file_out);
#if NEW_STRINGS
c = waypointp->description.length();
gbfputc(c, mapsend_file_out);
gbfwrite(CSTR(waypointp->description), 1, c, mapsend_file_out);
#else
- tmp = waypointp->description;
+ char* tmp = waypointp->description;
if (tmp) {
c = strlen(tmp);
} else {
}
}
- wpt->extra_data = (void*)mkshort(hshort_wpt, CSTR(wpt->shortname));
+ wpt->extra_data = (void*)mkshort(hshort_wpt, CSTRc(wpt->shortname));
waypt_table[waypt_table_ct] = (waypoint*)wpt;
waypt_table_ct++;